package com.gw.vip.server.controller;

import com.gw.vip.common.log.PrintlnLog;
import com.gw.vip.common.vo.Result;
import com.gw.vip.server.dto.QueryDto;
import com.gw.vip.server.service.MainService;
import com.gw.vip.server.service.dao_service.OrderAllService;
import com.gw.vip.server.sign.RequiredSign;
import com.gw.vip.server.vo.MainAccResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author GW 光武
 * @description
 * @since 2023-03-26
 */
@RestController
@RequestMapping("order")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderController {

    private final OrderAllService orderAllService;

    @PrintlnLog(description = "主账户订单查询")
    @PostMapping("orderQuery")
    @RequiredSign
    public Result orderQuery(@RequestBody @Valid QueryDto dto){
        MainAccResponse vo = orderAllService.orderQuery(dto);
        return Result.success(vo);
    }
}
